import os
import datetime


class CheckServer(object):
    def __init__(self) -> None:
        pass

    def timeFun(self, sched_Timer):
        # # flag = 0
        # while True:
        # now = datetime.datetime.now()
        now = datetime.datetime(2023, 12, 11, 18, 1, 55)
        if now == sched_Timer:
            os.system('/VScode/app_framework/run.sh')
        else:
            print('时间不匹配！')
        #     flag = 1
        # else:
        #     if flag == 1:
        #         sched_Timer = sched_Timer + datetime.timedelta(minutes=1)
        #         print('run the timer task at{0}'.format(sched_Timer))
        #         flag = 0


if __name__ == "__main__":
    cs = CheckServer()
    sched_Timer = datetime.datetime(2023, 12, 11, 18, 1, 55)
    print(sched_Timer)
    print('run the timer task at{0}'.format(sched_Timer))
    cs.timeFun(sched_Timer)
